package com.mmall.common;

import com.google.common.collect.Sets;
import com.mmall.pojo.Cart;

import java.util.Set;
public class Const {

    public static final String CURRENT_USER = "currentUser";

    private static final String EMAIL = "email";

    private static final String USERNAME = "username";


    public  interface produceListOrderBy{

     Set<String> PRICE_ASC_DESC = Sets.newHashSet("price_asc","price_desc");
     //Set contains()的时间复杂度是OE ,List的时间复杂度是ON
 }

    public interface RedisCacheExtime{
        int REDIS_SESSION_EXTIME = 60 * 30;//30分钟
    }
  public interface  Role{
         int ROLE_CUSTOMER=0;//普通用户
         int ROLE_ADMIN=1;
     }

    public enum ProductStatusEnum{
         ON_SALE(1,"在售");
         private int code;
         private String value;
        ProductStatusEnum(int code,String value){
              this.code=code;
             this.value=value;
          }
    }
    public interface Cart{
        int CHECKED= 1;//选中状态
        int NOTCHECKED = 0;
    }

    public enum OrderStatusEnum{

        CANCELED(0,"已取消"),

        NOPAY(10,"未支付"),

        PAID(20,"已付款"),

        SHIPPED(40,"已发货"),

        ORDER_SUCCESS(50,"已完成"),

        ORDER_CLOSED(60,"已关闭");

        private int code;

        private String value;
        OrderStatusEnum(int code,String value){
            this.code=code;
            this.value=value;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }
    public enum PayPlatformEnum{

        ZHIFUBAO(1,"支付宝"),

        WECHAT(0,"微信");

        private int code;

        private String value;

        PayPlatformEnum(int code,String value){
            this.code=code;
            this.value=value;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }

    public interface  AlipayCallBack{

        public static String WAIT_BUYER_PAY ="WAIT_BUYER_PAY";

         public static String  TRADE_CLOSED ="TRADE_CLOSED";

         public static String   TRADE_SUCCESS ="TRADE_SUCCESS";

         public static String TRADE_FINISHED = "TRADE_FINISHED";

        public static String  RESPONSESUCCESS = "SUCCESS";

        public static String  RESPONSEFAIL  = "FAIL";

        // WAIT_BUYER_PAY	交易创建，等待买家付款
        //TRADE_CLOSED	未付款交易超时关闭，或支付完成后全额退款
        //TRADE_SUCCESS	交易支付成功
        //TRADE_FINISHED	交易结束，不可退款


    }
    public enum PaymentTypeEnum{

        ON_LINE(1,"在线支付");

        private int code;

        private String value;

        PaymentTypeEnum(int code,String value){
            this.code=code;
            this.value=value;
        }

        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }

    public interface  REDIS_LOCK{
        String CLOSE_ORDER_TASK_LOCK = "CLOSE_ORDER_TASK_LOCK";//关闭订单的分布式锁
    }

}







